# $Id: genlist.tcl 44 2007-09-03 00:47:25Z khomoutov $
# Test script that makes either files.xml.bz2 or NMDC filelist
# for a given share in a given database.

lappend auto_path tcldc
package require dcshare
namespace import ::dcshare::*

if {$argc == 1} {
	set cmd [lindex $argv 0]
} else {
	return -code error "Usage: $argc0 xmlbzlist|dclist"
}

switch -glob -- $cmd {
	xml* -
	bz* {
		set cmd xmlbzlist
		set fname files.xml.bz2
	}
	dc* -
	nmdc* {
		set cmd dclist
		set fname MyList.dcList
	}
	default {
		return -code error "bad mode \"$cmd\":\
			must be one of xmlbzlist or dclist"
	}
}

database open ./scratch.db
set start [clock seconds]
share $cmd dummy $fname
set end [clock seconds]
puts "[expr $end-$start] seconds"

database close

